//
// Created by hunan on 24-12-2.
//

#ifndef OPENSSL_UTIL_H
#define OPENSSL_UTIL_H

#include <cstdint>
#include <string>

class OpenSSLUtil
{
public:
    static void EncodeDataToMD5(const unsigned char * data, int length, std::string & result);
    static void EncodeDataToMD5(const std::string & data, std::string & result);
    static int  ComputeFileMD5(const std::string  & file, std::string & result);
    static void EncodeDataSHA256(const std::string & data, std::string & result);
    static void EncodeDataSHA1(const std::string & data, std::string & result);
    static void EncodeDataSHA1(const uint8_t * data, int data_length, std::string & result);
    static void EncodeHMACSHA1(const uint8_t * data, int data_length, const std::string & key, std::string & result);
    static void EncodeHMACSHA1(const std::string & data, const std::string & key, std::string & result);
    static void Hex(const unsigned char * data, int length, char * result, int result_length);

private:
};

#endif // OPENSSL_UTIL_H
